/* 登录页面样式 */

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --wechat-green: #07c160;
  --qq-blue: #12b7f5;
  --apple-black: #000000;

  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-light: #ffffff;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e0;
  --border-focus: #667eea;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* 登录应用容器 */
.login-app {
  max-width: 375px;
  margin: 0 auto;
  min-height: 100vh;
  background: white;
  position: relative;
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
}

/* 状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  height: 44px;
  padding-top: calc(8px + var(--safe-area-top));
  position: relative;
  z-index: 10;
  color: var(--text-light);
}

.status-right {
  display: flex;
  gap: 4px;
  align-items: center;
}

.status-right i {
  font-size: 12px;
  opacity: 0.9;
}

/* 登录容器 */
.login-container {
  height: calc(100vh - 44px - var(--safe-area-top));
  position: relative;
  overflow-y: auto;
}

/* 背景装饰 */
.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: floatShapes 8s ease-in-out infinite;
  backdrop-filter: blur(1px);
}

.shape-1 {
  width: 120px;
  height: 120px;
  top: 5%;
  left: -30px;
  background: linear-gradient(
    45deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.1)
  );
  animation-delay: -1s;
}

.shape-2 {
  width: 80px;
  height: 80px;
  top: 15%;
  right: -20px;
  background: linear-gradient(
    45deg,
    rgba(240, 147, 251, 0.2),
    rgba(245, 87, 108, 0.1)
  );
  animation-delay: -3s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: -80px;
  background: linear-gradient(
    45deg,
    rgba(17, 153, 142, 0.15),
    rgba(56, 239, 125, 0.1)
  );
  animation-delay: -5s;
}

.shape-4 {
  width: 60px;
  height: 60px;
  bottom: 30%;
  right: 20px;
  background: linear-gradient(
    45deg,
    rgba(102, 126, 234, 0.25),
    rgba(118, 75, 162, 0.15)
  );
  animation-delay: -2s;
}

.shape-5 {
  width: 150px;
  height: 150px;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    45deg,
    rgba(240, 147, 251, 0.15),
    rgba(245, 87, 108, 0.1)
  );
  animation-delay: -4s;
}

@keyframes floatShapes {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.6;
  }
  33% {
    transform: translateY(-30px) rotate(120deg);
    opacity: 0.8;
  }
  66% {
    transform: translateY(15px) rotate(240deg);
    opacity: 0.4;
  }
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0.95;
}

/* 登录内容 */
.login-content {
  position: relative;
  z-index: 2;
  padding: 40px 24px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 应用品牌 */
.app-branding {
  text-align: center;
  margin-bottom: 48px;
  color: var(--text-light);
}

.logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.app-logo {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-light);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: logoRotate 10s linear infinite;
}

@keyframes logoRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.logo-rings {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  pointer-events: none;
}

.ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: ringPulse 3s ease-in-out infinite;
}

.ring-1 {
  animation-delay: 0s;
}

.ring-2 {
  animation-delay: 1.5s;
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.app-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 400;
}

/* 登录表单区域 */
.login-form-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl);
  padding: 32px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 认证标签 */
.auth-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 32px;
  position: relative;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.auth-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: var(--shadow-md);
  left: 4px;
}

.auth-tab[data-tab='register'].active ~ .tab-indicator {
  left: calc(50%);
}

/* 表单样式 */
.auth-form {
  transition: all 0.3s ease;
}

.auth-form.hidden {
  display: none;
}

.form-group {
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  z-index: 2;
  transition: all 0.3s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input:focus + .password-toggle,
.input-wrapper input:focus ~ .input-icon {
  color: var(--border-focus);
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  padding: 4px;
  border-radius: 4px;
}

.password-toggle:hover {
  color: var(--border-focus);
  background: rgba(102, 126, 234, 0.1);
}

.input-focus-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
  border-radius: 1px;
}

.input-wrapper input:focus ~ .input-focus-line {
  width: 100%;
}

/* 表单选项 */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.remember-me,
.agree-terms {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.remember-me input,
.agree-terms input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.checkmark::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: all 0.3s ease;
}

input:checked + .checkmark {
  background: var(--primary-gradient);
  border-color: transparent;
}

input:checked + .checkmark::after {
  opacity: 1;
}

.forgot-password {
  color: var(--border-focus);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  text-decoration: underline;
}

.agree-terms .label-text a {
  color: var(--border-focus);
  text-decoration: none;
}

.agree-terms .label-text a:hover {
  text-decoration: underline;
}

/* 认证按钮 */
.auth-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.auth-button.primary {
  background: var(--primary-gradient);
  color: var(--text-light);
  box-shadow: var(--shadow-lg);
}

.auth-button.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.auth-button.primary:active {
  transform: translateY(0);
}

.button-text {
  transition: opacity 0.3s ease;
}

.button-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-button.loading .button-text {
  opacity: 0;
}

.auth-button.loading .button-loader {
  opacity: 1;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 分割线 */
.divider {
  display: flex;
  align-items: center;
  margin: 32px 0;
  color: var(--text-light);
  opacity: 0.8;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.divider span {
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
}

/* 第三方登录 */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.social-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.social-button:active {
  transform: translateY(0);
}

.social-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.social-button.wechat .social-icon {
  color: var(--wechat-green);
}

.social-button.qq .social-icon {
  color: var(--qq-blue);
}

.social-button.apple .social-icon {
  color: var(--apple-black);
}

/* 快速体验 */
.quick-actions {
  margin-bottom: 24px;
}

.quick-experience {
  width: 100%;
  padding: 12px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-light);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quick-experience:hover {
  border-style: solid;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* 页脚 */
.auth-footer {
  margin-top: auto;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  padding-bottom: var(--safe-area-bottom);
}

.version-info {
  margin-bottom: 8px;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.separator {
  opacity: 0.5;
}

/* 欢迎动画遮罩 */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.welcome-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-content {
  text-align: center;
  color: var(--text-light);
  max-width: 280px;
  padding: 0 20px;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 24px;
  animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.welcome-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-content p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.welcome-progress {
  margin-top: 24px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

/* Toast消息 */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 320px;
  width: 90%;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-lg);
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
}

.toast.success {
  background: var(--success-gradient);
}

.toast.error {
  background: var(--secondary-gradient);
}

.toast.info {
  background: var(--primary-gradient);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* 响应式设计 */
@media (max-height: 700px) {
  .app-branding {
    margin-bottom: 32px;
  }

  .app-logo {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .app-title {
    font-size: 24px;
  }

  .login-form-section {
    padding: 24px 20px;
  }
}

@media (max-height: 600px) {
  .login-content {
    padding: 20px 24px 24px;
  }

  .app-branding {
    margin-bottom: 24px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-options {
    margin-bottom: 24px;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e0;
    --text-muted: #94a3b8;
    --border-light: #334155;
    --border-medium: #475569;
  }
}
